Fix warning when switching spaces in leopard.
authorRichard Hult <richard@imendio.com>
Thu, 6 Dec 2007 12:39:01 +0000 (12:39 +0000)
committerRichard Hult <rhult@src.gnome.org>
Thu, 6 Dec 2007 12:39:01 +0000 (12:39 +0000)
2007-12-06  Richard Hult  <richard@imendio.com>

* gdk/quartz/gdkevents-quartz.c:
(synthesize_crossing_events_for_ns_event): Fix warning when
switching spaces in leopard.

svn path=/trunk/; revision=19119

ChangeLog
gdk/quartz/gdkevents-quartz.c

index 2748eda802e38583fabf1486de42ba8d1d485c94..6a5a4c9b7a5374d90a87e7237c1b1b2cb53ddd6c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-06  Richard Hult  <richard@imendio.com>
+
+       * gdk/quartz/gdkevents-quartz.c:
+       (synthesize_crossing_events_for_ns_event): Fix warning when
+       switching spaces in leopard.
+
 2007-12-06 13:38:36  Tim Janik  <timj@imendio.com>
 
        * tests/floatingtest.c: ported to new testing framework.
index 71e84762202f044e406cbd71d6dd5151ce556f6b..01dea29dcac80252cbd2971971efcb27223e3794 100644 (file)
@@ -1172,7 +1172,8 @@ synthesize_crossing_events_for_ns_event (NSEvent *nsevent)
 
         /* If there is a window other than the root window at this
          * position, it means we didn't exit to the root window and we
-         * ignore the event.
+         * ignore the event. (Note that we can get NULL here when swithing
+         * spaces for example.)
          *
          * FIXME: This is not enough, it doesn't catch the case where
          * we leave a GDK window to a non-GDK window that has GDK
@@ -1180,9 +1181,12 @@ synthesize_crossing_events_for_ns_event (NSEvent *nsevent)
          */
         mouse_window = _gdk_quartz_window_find_child (_gdk_root, x, y);
 
-        if (gdk_window_get_toplevel (mouse_window) == 
+        if (!mouse_window ||
+            gdk_window_get_toplevel (mouse_window) ==
             gdk_window_get_toplevel (current_mouse_window))
-          mouse_window = _gdk_root;
+          {
+            mouse_window = _gdk_root;
+          }
 
         if (mouse_window == _gdk_root)
           synthesize_crossing_events (_gdk_root, GDK_CROSSING_NORMAL, nsevent, x, y);